package com.feri.ssm.controller;

import com.feri.ssm.entity.User;
import com.feri.ssm.service.intf.UserService;
import com.feri.ssm.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller //IOC创建
@RequestMapping("/api/user")
public class UserController {
    @Autowired
    private UserService service;

    @RequestMapping("save.do")
    @ResponseBody
    public R save(User user){
        return service.save(user);
    }
    @RequestMapping("all.do")
    @ResponseBody
    public R all(){
        return service.queryAll();
    }
}
